home *** CD-ROM | disk | FTP | other *** search
-
- import sys, string
-
- if __name__ != '__main__':
- import js
- import ff
-
- # ---------------------------------------------------------------
- # Console Redirection To Engine - redirect to game engine
- #
- class ConsoleText:
- def __init__(self):
- self.text = ''
-
- def write(self, string):
- #self.text = self.text + string
- if __name__ != '__main__':
- js.writeText(string)
- else:
- sys.stderr.write(string)
-
- def writelines(self, lines):
- for line in lines:
- self.write(line)
-
- con = ConsoleText()
- sys.stdout = con
- sys.stderr = con
-